package com.llt.music.tools;


import lombok.Data;

@Data
public class Result {

    private int statu; // 200 成功 -1 失败
    private String message; // 主要是发给前端错误原因
    private Object data;

    public static Result success(String message, Object data) {
        Result result = new Result();
        result.setStatu(200);
        result.setMessage(message);
        result.setData(data);

        return result;
    }

    public static Result fail(String message) {
        Result result = new Result();
        result.setStatu(-1);
        result.setMessage(message);
        result.setData(null);

        return result;
    }

}
